import myutil
import json
print(dir(json))
files=myutil.mylistdir(".","*.json")
data=[]
for f in files:
    # print(f)
    fc=open(f,"rb").read()
    # print(fc)
    try:
        json1=json.loads(fc.decode("utf-8"))
        data.append(json1)
    except json.decoder.JSONDecodeError as e:
        json1=json.loads(fc[3:].decode("utf-8"))
        data.append(json1)
# print(data)
f=open("stages.js","w")
f.write("export default const stages=[")
for one in data:
    fc=json.dumps(one)
    f.write(fc)
    f.write(",\n")
f.write("]")
f.close()

